package q002;

public class ListNode {
     int val;
   ListNode next;
     ListNode(int x) { val = x; }

    ListNode(int[] arr) {
         ListNode head = this;
         for (int i = 0; i < arr.length ;i++) {
             head.val = arr[i];
             if (i != arr.length - 1) {
                 head.next = new ListNode(0);
                 head = head.next;
             }
         }
    }
 }